home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / COUNTRY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  1.2 KB  |  51 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3. main()
  4. {
  5.     struct country c_info;
  6.  
  7. /* Get date, time and currency format for
  8.  * current country */
  9.     country(0, &c_info);
  10. /* Display the information */
  11.     printf("=============== For this country ===============\n");
  12.     printf("Date is of the form: ");
  13.     switch(c_info.co_date)
  14.     {
  15.         case 0:
  16.             printf("MM%sDD%sYY\n", c_info.co_dtsep,
  17.                 c_info.co_dtsep);
  18.             break;
  19.         case 1:
  20.             printf("DD%sMM%sYY\n", c_info.co_dtsep,
  21.                 c_info.co_dtsep);
  22.             break;
  23.         case 2:
  24.             printf("YY%sMM%sDD\n", c_info.co_dtsep,
  25.                 c_info.co_dtsep);
  26.             break;
  27.     }
  28.     printf("Time is of the form: HH%sMM%sSS\n",
  29.         c_info.co_tmsep, c_info.co_tmsep);
  30.     printf("Currency style: ");
  31.     switch(c_info.co_currstyle)
  32.     {
  33.         case 0:
  34.             printf("%s9%s999%s99\n", c_info.co_curr,
  35.                 c_info.co_thsep, c_info.co_desep);
  36.             break;
  37.         case 1:
  38.             printf("9%s999%s99%s\n", c_info.co_thsep,
  39.                 c_info.co_desep, c_info.co_curr);
  40.             break;
  41.         case 3:
  42.             printf("%s 9%s999%s99\n", c_info.co_curr,
  43.                 c_info.co_thsep, c_info.co_desep);
  44.             break;
  45.         case 4:
  46.             printf("9%s999%s99 %s\n", c_info.co_thsep,
  47.                 c_info.co_desep, c_info.co_curr);
  48.             break;
  49.     }
  50. }
  51.